iOS Backup & Sync: "use NOOP's own folder" fallback + folder-picker instrumentation (#52)#66
Merged
Merged
Conversation
…ker instrumentation (#52) On some iOS 26 builds the system folder picker's Open button never fires, so users can't select any folder (external) — three reports, works for one. Two prior blind picker fixes (#859, #1000a) shipped and didn't resolve it. Fix, two parts: - Fallback: add "Use NOOP's own folder" — backs up inside NOOP's own Documents/Backups, already exposed in Files (UIFileSharingEnabled + LSSupportsOpeningDocumentsInPlace) under On My iPhone -> NOOP, with zero dependence on the picker. resolveFolder() short-circuits to it (no security-scoped bookmark; the existing scoped brackets no-op), so backup / restore / prune / auto-catchup all work unchanged. An explicit external pick turns it back off. The no-folder alert now points users at it. - Instrumentation: record the last picker delegate outcome (picked / cancelled) and, on a returned URL, whether scoped-access opened and the bookmark minted, surfaced in the debug export. One on-device export now tells us whether the picker's Open never fired (iOS-side) vs a returned folder we failed to persist (our bug) — instead of guessing.
64b8348 to
1fe396f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the practical blocker in #52: on some iOS 26 builds the system folder picker's Open button never fires, so users can't select any folder (three reports — fai150, KillaBoi confirm; works for pdomagala). Two prior blind picker fixes (#859 button-greyed, #1000a
directoryURL) already shipped and didn't resolve it, and the symptom ("Open does nothing → swipe-dismiss → No folder selected") means the picker never returns a URL — not something our callback code drops.Part 1 — picker-free fallback (the unblock)
NOOP already ships
UIFileSharingEnabled+LSSupportsOpeningDocumentsInPlace(project.yml), so its own Documents folder is already visible in Files under On My iPhone → NOOP. New "Use NOOP's own folder" button backs up intoDocuments/Backupswith no picker and no security-scoped bookmark:resolveFolder()short-circuits to the internal folder when opted in; the existing scoped-access brackets just no-op (it's our own sandbox), so backup / restore / prune / auto-catch-up all work unchanged.saveFolder) turns the fallback back off.Users read those backups from the Files app, or drag the folder into iCloud Drive to open on the Mac. (A first-class iCloud-Drive container is a separate, larger change.)
Part 2 — instrument the picker (so we can stop guessing)
There was zero logging in this path. Now the last picker delegate outcome (
picked/cancelled) and, on a returned URL, whether scoped-access opened and the bookmark minted, are recorded and shown in the debug export. One on-device export now distinguishes:cancelled/never used→ the picker's Open never fired (iOS-side; fallback sidesteps it), vspicked+ a FAILED flag → a returned folder we failed to persist (our bug).Testing
Swift can't build on the maintainer's box; needs CI + an on-device run. KillaBoi offered to sideload with a devcert — an instrumented build + his export pins the picker's future.
Files:
Strand/Data/BackupSync.swift,Strand/Screens/BackupSyncView.swift,Strand/System/DocumentPicker.swift,Strand/System/DebugDataDiagnostics.swift.